set Target_Name=app_eflash

cd /d %~dp0
:: C:\Keil\ARM\ARMCC\bin\fromelf --bin --output .\project.bin  .\project.axf
:: C:\Keil\ARM\ARMCC\bin\fromelf --text -a -c --output=.\project.lst  .\project.axf

del %Target_Name%.bin
del %Target_Name%.hex

copy .\Objects\Project.axf Project.axf
copy .\Objects\Project.hex Project.hex
copy .\Listings\Project.map Project.map

BinScript.exe BinScript.BinScript
makecode.exe
Crc16Merge.exe app_eflash.bin
BinScript.exe BinScript_app_hex.BinScript

rename app_eflash.bin %Target_Name%.bin
rename app_eflash.hex %Target_Name%.hex
